/*    */ package com.zimbra.cs.ldap;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public enum LdapConnType
/*    */ {
/* 20 */   PLAIN, 
/* 21 */   LDAPS, 
/* 22 */   STARTTLS, 
/* 23 */   LDAPI;
/*    */   
/*    */   private static final String LDAPI_SCHEME = "ldapi";
/*    */   private static final String LDAPS_SCHEME = "ldaps";
/*    */   
/*    */   private LdapConnType() {}
/*    */   
/*    */   public static LdapConnType getConnType(String urls, boolean wantStartTLS) {
/* 31 */     if (urls.toLowerCase().contains("ldapi://"))
/* 32 */       return LDAPI;
/* 33 */     if (urls.toLowerCase().contains("ldaps://"))
/* 34 */       return LDAPS;
/* 35 */     if (wantStartTLS) {
/* 36 */       return STARTTLS;
/*    */     }
/* 38 */     return PLAIN;
/*    */   }
/*    */   
/*    */ 
/*    */   private static final String LDAPI_URL = "ldapi://";
/*    */   private static final String LDAPS_URL = "ldaps://";
/*    */   public static boolean requireStartTLS(String[] urls, boolean wantStartTLS)
/*    */   {
/* 46 */     if (wantStartTLS) {
/* 47 */       for (String url : urls) {
/* 48 */         if (url.toLowerCase().contains("ldaps://"))
/* 49 */           return false;
/*    */       }
/* 51 */       return true;
/*    */     }
/* 53 */     return false;
/*    */   }
/*    */   
/*    */   public static boolean isLDAPI(String scheme) {
/* 57 */     return "ldapi".equalsIgnoreCase(scheme);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/ldap/LdapConnType.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */